﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinForm02
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string email = textBox1.Text;
            string pwwd = textBox2.Text;
            string repwwd = textBox3.Text;

            if (string.IsNullOrEmpty(email))
            {
                MessageBox.Show("邮箱地址不能为空！");
                return;
            }
            else if (string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("密码不能为空！");
                return;
            }
            else if (!textBox2.Text.Equals(textBox3.Text))
            {
                MessageBox.Show("两次输入的密码不一致！");
                return;
            }
            if (textBox1.Text == email && textBox2.Text == pwwd && textBox3.Text == repwwd)
            {
                DialogResult ds = MessageBox.Show("注册成功", "注册", MessageBoxButtons.OK, MessageBoxIcon.Information);
               

            }
            else
            {
                DialogResult dz = MessageBox.Show("注册失败,是否退出注册？", "失败", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dz == DialogResult.Yes)
                {
                    Application.Exit();
                }
               
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
